import { BasicColumn, FormSchema } from "/@/components/Table";
import { render } from "/@/utils/common/renderUtils";

export const columns: BasicColumn[] = [
  { title: "状态", dataIndex: "stat", customRender: ({text}) => render.renderDict(text, 'stateType'),},
  { title: "包厢编号", dataIndex: "number" },
  { title: "包厢名称", dataIndex: "name" },
  { title: "排序", dataIndex: "sort" },
  { title: "创建日期", dataIndex: "createTime" }
];

export const searchFormSchema: FormSchema[] = [
  {
    label: "状态",
    field: "stat",
    component: "JDictSelectTag",
    componentProps: {
      dictCode: "stateType",
      placeholder: "请选择状态",
      stringToNumber: true
    },
  },
  {
    label: "包厢名称",
    field: "name",
    component: "Input"
  }
];

export const formSchema: FormSchema[] = [
  // TODO 主键隐藏字段，目前写死为ID
  { label: "", field: "id", component: "Input", show: false },
  {
    label: "状态",
    field: "stat",
    component: "JDictSelectTag",
    componentProps: {
      dictCode: "stateType",
      placeholder: "请选择状态",
      stringToNumber: true
    },
  },
  {
    label: "包厢编号",
    field: "number",
    component: "Input"
  },
  {
    label: "包厢名称",
    field: "name",
    component: "Input"
  },
  {
    label: "排序",
    field: "sort",
    component: "Input"
  },
];
